.tab-ports {
    position: relative;
}

#tab-ports-templates {
    display: none;
}

.tab-ports table {
    margin-bottom: 10px;
    width: 100%;
    border-collapse: collapse;
}

.tab-ports table, .tab-ports table th, .tab-ports table td {
    border-left: 0;
    border-right: 0;
    border-top: 0;
}

.tab-ports table tr td:first-child {
    text-align: left;
}

.tab-ports table td {
    border-bottom: 1px solid var(--subtleAccent);
    padding: 3px 3px 3px 5px;
    border-left: 1px solid var(--subtleAccent);
    border-right: 1px solid var(--subtleAccent);
}

.tab-ports table thead tr:first-child, .tab-ports table tr:nth-child(even) select,
.tab-ports table thead tr:first-child, .tab-ports table tr:nth-child(even) {
    background-color: var(--alternativeBackground);
}

.tab-ports table thead tr:first-child {
    font-size: 12px;
    height: 25px;
    border-top: 0;
    border-right: 0;
    border-left: 0;
}

.tab-ports .function input {
    vertical-align: -2px;
}

.tab-ports .function label {
    margin-right: 5px;
}

.tab-ports select {
    border: 1px solid var(--subtleAccent);
    border-radius: 3px;
    margin-right: 3px;
    background: var(--boxBackground);
    color: var(--defaultText);
}

.tab-ports .require-support {
    display: none;
}

.tab-ports.supported .require-support {
    display: block;
}

.tab-ports .require-upgrade {
    display: block;
}

.tab-ports.supported .require-upgrade {
    display: none;
}

/* margin required when cell contents wrap */
.tab-ports .ports select {
    margin-top: 5px;
    margin-bottom: 5px;
}

.tab-ports .ports select[name=function-peripherals],
.tab-ports .ports select[name=function-telemetry] {
    max-width: 110px;
}

.tab-ports .ports td {
    text-align: center;
}

.tab-ports .ports thead td {
    white-space: nowrap;
    padding: 5px 7px;
    background-color: var(--quietHeader);
    color: var(--quietText);
}

.tab-ports .ports thead td:first-child {
    text-align: left;
    border-top-left-radius: 5px;
    border-left: 0;
}

.tab-ports .ports thead td:last-child {
    border-top-right-radius: 5px;
    border-right: 0;
}

@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
    .tab-ports table thead tr:first-child {
        font-size: 12px;
        height: 22px;
    }
}

@media all and (max-width: 575px) {
    .tab-ports .config {
        text-align: left;
        border-top-left-radius: 5px;
        border-left: 0;
    }
    .tab-ports table td {
        padding: 0;
    }
    .tab-ports .ports select {
        margin: 0;
        width: 100%;
        border: none;
        height: 25px;
        border-radius: unset;
    }
    .tab-ports .portIdentifier td {
        height: 18px;
        background-color: #D6D6D6;
        padding: 2px 5px;
        font-size: 12px;
        color: #828282;
        font-weight: normal;
        background-image: linear-gradient(315deg, rgba(255, 255, 255, .2) 10%, transparent 10%, transparent 20%,
            rgba(255, 255, 255, .2) 20%, rgba(255, 255, 255, .2) 30%, transparent 30%, transparent 40%,
            rgba(255, 255, 255, .2) 40%, rgba(255, 255, 255, .2) 50%, transparent 50%, transparent 60%,
            rgba(255, 255, 255, .2) 60%, rgba(255, 255, 255, .2) 70%, transparent 70%, transparent 80%,
            rgba(255, 255, 255, .2) 80%, rgba(255, 255, 255, .2) 90%, transparent 90%, transparent 100%,
            rgba(255, 255, 255, .2) 100%, transparent);
    }
    .tab-ports .ports select[name=function-peripherals], .tab-ports .ports select[name=function-telemetry],
    .tab-ports .ports select[name=function-sensors] {
        border-bottom: 1px solid var(--subtleAccent);
    }
    .tab-ports .ports thead td {
        font-size: 8px;
        width: calc(100% / 5);
        word-break: break-word;
        white-space: unset;
    }
}
